package com.simple.chiraliumauth.dto;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * chiralium用户
 *
 * @author SimpleZzz
 * @date 2021/12/09
 */
public class ChiraliumUser extends User {

    /**
     * pk id
     */
    @Getter
    private final Long pkId;

    /**
     * chiralium用户 构造方法
     *
     * @param pkId                  pk id
     * @param username              用户名
     * @param password              密码
     * @param enabled               启用
     * @param accountNonExpired     账户不过期
     * @param credentialsNonExpired 凭证不过期
     * @param accountNonLocked      非锁定账户
     * @param authorities           权限列表
     */
    public ChiraliumUser(Long pkId, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.pkId = pkId;
    }
}
